<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Insert title here</title>
</head>
<body>
	<script>
		function Pet(name) {

			this.name = name;

		}

		Pet.prototype.greet = function() {
			return this.name + " says " + this.sound
		};

		function Cat(name) {

			Pet.call(this, name);

			this.sound = "Miav";

		}

		function Dog(name) {

			Pet.call(this, name);

			this.sound = "Vuff";

		}

		Cat.prototype = new Pet;

		Dog.prototype = new Pet;

		var x = new Dog("ShitDog");

		var y = new Cat("ShitCat");

		alert(x.greet());
	</script>
</body>

</html>